﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Dynamic;

namespace CSharp_DynamicObject
{
    public class MeuDynamic : DynamicObject
    {
        public override bool TrySetMember(SetMemberBinder binder, object value)
        {
            Console.WriteLine("Está a tentar atribuir: {0}", value);
            return true;
        }

        public override bool TryGetMember(GetMemberBinder binder, out object result)
        {
            Console.WriteLine("Está a tentar obter: {0}", binder.Name);
            
            result = "Maria";
            return true;
        }
    }
}
